package likenClient;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Client extends JFrame{
	
	private JLabel userName;
	private JLabel password;
	private JLabel newUser;
	private JLabel welcome;
	private JTextField userTF;
	private JTextField passTF;
	private JButton login, exit, create;

	private exitButtonHandler ebHandler;
	
	
	
	private static final int WIDTH = 350;
	private static final int HEIGHT = 400;
	
	public Client()	{
		
		try {
			UIManager.setLookAndFeel(
					UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException | InstantiationException
				| IllegalAccessException | UnsupportedLookAndFeelException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
					
		
		welcome = new JLabel("Welcome to Liken!");
		
		userName = new JLabel("Username: ", SwingConstants.LEFT);
		userTF = new JTextField(10);
		
		password = new JLabel("Password: ", SwingConstants.LEFT);
		passTF = new JTextField(10);
		
		newUser = new JLabel("Don't have an Account? Create a new one.");
		
		login = new JButton("Login");

				
		exit = new JButton("Exit");
		ebHandler = new exitButtonHandler();
		exit.addActionListener(ebHandler);
		
		create = new JButton("Create New Account");

		
		setTitle("Liken Login");
		
		Container pane = getContentPane();
		
		pane.setLayout(new GridLayout(15, 10));
		
		pane.add(welcome);
		pane.add(userName);
		pane.add(userTF);
		pane.add(password);
		pane.add(passTF);
		pane.add(login);
		pane.add(exit);
		pane.add(newUser);
		pane.add(create);
		
		
		
		
		
		setSize(WIDTH, HEIGHT);
		setVisible(true);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		
	}
	
	private class exitButtonHandler implements ActionListener
	{
		public void actionPerformed(ActionEvent e)
		{
			System.exit(0);
		}
	}
	

	public static void main(String[] args)
	{
	 	Client client = new Client();
	}

}
